#include<stdio.h>
void DigiTran(int k,char res[])
{
	if(k==0)
	{
		res[0]='A'+0;
		res[1]='\0';
		return;
	}
	else
	{
	int weishu[100];
	int inweishu=0;
	while(k!=0)
	{
		weishu[inweishu]=k%10;
		inweishu++;
		k=k/10;
	}
	int i,j;
	for(i=0,j=inweishu-1;i<j;i++,j--)
	{
		int temp1=weishu[i];
		weishu[i]=weishu[j];
		weishu[j]=temp1;
	}
	int inres=0;
	int temp2=0;
	while(temp2!=inweishu-1)
	{
		if(weishu[temp2]*10+weishu[temp2+1]<=25)
		{
			res[inres]=weishu[temp2]*10+weishu[temp2+1]+'A';
			inres++;
			temp2=temp2+2;
		}
		else
		{
			res[inres]=weishu[temp2]+'A';
			inres++;
			temp2++;
		}
	}
	if(temp2==inweishu-1)
	{
		res[inres]=weishu[inweishu-1]+'A';
		inres++;
	}
	res[inres]='\0';
    }
}
int main()
{
	int arr[100];
	int inarr=0;
	while(1)
	{
		int num;
		scanf("%d",&num);
		if(num==-1)
		{
			break;
		}
        else
        {
			arr[inarr]=num;
			inarr++;
		}
	}
	int i;
	char res[100];
	for(i=0;i<inarr;i++)
	{
		DigiTran(arr[i],res);
		printf("%s ",res);
	}
	return 0;
}
